#ifndef CVX_VIDEO_H
#define CVX_VIDEO_H 1

#include "cvxImage.h"
#include <vector>
#include <string>

using std::vector;
using std::string;


class CvxVideo 
{
public:
	//show image sequences as a video
	static void showVideo(const vector<_IplImage*>& imageVec, int interval = 10);
	//horizontal combine two video to an image sequence
	static bool horizontalCombineAVI(char* fileNameA, char* fileNameB, int interval = 10);

	static bool horizontalCombineAVI(string fileNameA, string fileNameB, string saveFile, float scale, int interval = 10);
	//
	static bool getImageFromAVI(char* fileName, vector<IplImage*>& outImg, int maxFrame = 1500);

	//write image sequence to a .avi file.		
	static bool writeImageToAVI(const vector<IplImage *> &Imgs, const string fileName, double fps = 24);

	//write a capture to a .avi file with different fps and solution, it jumps several frams at first
	static bool writeToAVI(const string fromFileName, const string toFileName, 
						   double fps, const CvSize &size, int jumpFrameNumbers, int frameLength, int flipMode);
	//write selected frame idx to .avi file
	static bool writeIdxToAVI(const string fromFileName, const string toFileName, 
							  double fps, const vector<int> &idx);
	//threshold is the disparity per marker position, make sure every frame can find chessboard
	static bool writeClearMarkToAVI(const string fromFileName, const string toFileName, 
									double fps, const CvSize boardSize, float threshold);

	

	//divide video to multiple video files
	// toFileNamePrefix \\folder\\v_
	static bool divideVideo(const string fromFileName, const string toFileNamePrefix, 
							vector<int> &stopIdx, double fps);
		
};


#endif